package com.aaa.three.controller;

import com.aaa.three.result.AjaxResult;
import com.aaa.three.service.HospitalNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("hospitalNews")
public class HospitalNewsController {


    @Autowired
    private HospitalNewsService hospitalNewsService;

    /**
     *  查询新闻
     */
    @RequestMapping("queryHospitalNews")
    public AjaxResult queryHospitalNews() {
        return hospitalNewsService.queryHospitalNews();
    }

    /**
     * 查询 新闻栏目相同的 新闻
     */
    @RequestMapping("listHospitalNews/{ncolumn}")
    public AjaxResult listHospitalNews(@PathVariable("ncolumn") Integer ncolumn) {
        return hospitalNewsService.listHospitalNews(ncolumn);
    }

    /**
     * 查询新闻栏目
     */
    @RequestMapping("listHospitalNewsColumn/{id}")
    public AjaxResult listHospitalNewsColumn(@PathVariable("id") Integer id) {
        return hospitalNewsService.listHospitalNewsColumn(id);
    }

    /**
     * 医院新闻首页的 欢迎页
     */
    @RequestMapping("hospitalNewsWelcomePage")
    public AjaxResult hospitalNewsWelcomePage() {
        return hospitalNewsService.hospitalNewsWelcomePage();
    }

    /**
     * 主页展示 新闻媒体
     */
    @RequestMapping("listNewsMedia")
    public AjaxResult listNewsMedia() {
        return hospitalNewsService.listNewsMedia();
    }

    /**
     * 主页展示 通知公告
     */
    @RequestMapping("listAnnouncement")
    public AjaxResult listAnnouncement() {
        return hospitalNewsService.listAnnouncement();
    }

    /**
     * 主页展示 置顶的新闻
     */
    @RequestMapping("listNewsOnTop")
    public AjaxResult listNewsOnTop() {
        return hospitalNewsService.listNewsOnTop();
    }

}
